#!/usr/bin/env python
# -*- coding: utf-8 -*-

import sys
import rospy
from pokemon_server.srv import PoseState,PoseStateResponse
from geometry_msgs.msg import Pose, PoseWithCovarianceStamped, Point, Quaternion, Twist 
def scheduler_client(request):
	# ROS节点初始化
	# 发现/show_stu服务后，创建一个服务客户端，连接名为/show_stu的service
    rospy.wait_for_service('/scheduler')
    try:
        scheduler_client = rospy.ServiceProxy('/scheduler', PoseState)
		# 请求服务调用，输入请求数据
        response = scheduler_client(request[0], request[1], request[2], request[3], request[4], request[5], request[6])
        pose = Pose(Point(response.position_x,response.position_y,response.position_z),Quaternion(response.orientation_x,response.orientation_y,response.orientation_z,response.orientation_w))
        return pose
    except rospy.ServiceException, e:
        print "Service call failed: %s"%e

if __name__ == "__main__":
	#服务调用并显示调用结果
    print(scheduler_client())


